package com.dly.blog.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDateTime;
import java.util.Date;

@Document(indexName = "content")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class GptSessionContentElasticsearch {

    @Id
    private Long id;

    /**
     * gpt的会话id
     */
    @Field(name = "session_id")
    private Long sessionId;

    /**
     * 对话角色
     */
    private String role;

    /**
     * 对话内容
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String content;

    /**
     * gpt的类型
     */
    @Field(name = "chat_type")
    private String chatType;

    /**
     * 创建时间
     */
    @Field(name = "create_time", type = FieldType.Date, format = {} , pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @Field(name = "update_time",type = FieldType.Date, format = {} , pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    /**
     * 创建人
     */
    @Field(name = "create_user")
    private Long createUser;

    /**
     * 更新人
     */
    @Field(name = "update_user")
    private Long updateUser;

    /**
     * 假删除
     */
    private Integer deleted;
}
